<template>
  <div style="width: 95vw;height: 90vh;">
    <Tinyflow
      ref="tinyflowRef"
      :className="'custom-tinyflow'"
      :style="{ height: '100%', border: '1px solid #ccc' }"
      :data="initialData"
    />
    <button @click="fetchData">获取流程数据</button>
  </div>
</template>

<script setup lang="ts">
import Tinyflow from './components/Tinyflow.vue';
import { ref } from 'vue';

const tinyflowRef = ref<InstanceType<typeof Tinyflow> | null>(null);
const initialData = ref({});

const fetchData = () => {
  if (tinyflowRef.value) {
    const data = tinyflowRef.value.getData();
    console.log('流程数据:', data);
  }
};
</script>